package com.ecity.view {
	import flash.display.Sprite;
	import org.papervision3d.cameras.Camera3D;
	import org.papervision3d.objects.DisplayObject3D;
	import org.papervision3d.render.BasicRenderEngine;
	import org.papervision3d.scenes.Scene3D;
	import org.papervision3d.view.Viewport3D;
	
	/**
	 * ...
	 * @author ss
	 */
	public class Viewer3d extends Sprite {
		public var camera:Camera3D;
		public var viewPort:Viewport3D;
		public var renderEngine:BasicRenderEngine;
		public var scene:Scene3D;
			
		public function Viewer3d() 	{
			camera = new Camera3D();
			viewPort = new Viewport3D(1200, 800,false,true);
			this.addChild(viewPort);
			renderEngine = new BasicRenderEngine();
			scene= new Scene3D();
		}
		
		public function setCameraTarget(child:DisplayObject3D):void {
			camera.target = child;
		}
		
		public function addModel(child:DisplayObject3D):void {
			scene.addChild(child);
		}
		public function renderFrame():void {
			 renderEngine.renderScene(scene, camera, viewPort);

		}
		
	}

}